//引用i18n
import { createI18n } from "vue-i18n";
import enLocale from "element-plus/lib/locale/lang/en"; //引入Element UI的英文包
// import zhLocale from "element-plus/lib/locale/lang/zh-CN";
import zhLocale from "element-plus/lib/locale/lang/zh-cn"; //引入Element UI的中文包

const i18n = createI18n({
  locale: localStorage.getItem("lan") || "zh", // 语言标识 //this.$i18n.locale // 通过切换locale的值来实现语言切换
  messages: {
    zh: Object.assign(require("./language-zh.json"), zhLocale),
    en: Object.assign(require("./language-en.json"), enLocale),
  },
  // messages:{
  //  'zh': Object.assign(require('./VueI18n/language-zh.json'), require('./VueI18n/demo-zh.json')),
  //  'en': Object.assign(require('./VueI18n/language-en.json'), require('./VueI18n/demo-en.json'))
  // }
});
export default i18n;
